#include "copyright.h"
#include "system.h"
#include "syscall.h"
#include "processTable.h"
#include <stdio.h>
#include <iostream>

ProcessTable::ProcessTable() {

  numProcess = 0;
  processArray[15];

}

int ProcessTable::addProcess(Process* newProcess) {

  for (int i = 0; i<15;i++) {
    if (processArray[i] == NULL) {
      numProcess ++;
      newProcess->setID(i);
      processArray[i] = newProcess;
      return i;
    }
  }
  return -1;
}

void ProcessTable::removeProcess(int index) {
    processArray[index] = NULL;
}

Process* ProcessTable::getProcess(int index) {
  return processArray[index];
}

